Low-Power IoT for Monitoring Unconnected Remote Areas

This paper deals with IoT devices deployed in remote areas without terrestrial Internet connectivity. We consider connecting IoT devices on the ground to the Internet through an aerial system based on an Unmanned Aerial Vehicle (UAV) for smart agriculture and environmental monitoring. The UAV flying over the remote area receives data from distributed IoT devices. The transmissions between the ground sensors and the UAV are carried out via LoRa. We have proposed a synchronization protocol for the opportunistic communication of LoRa IoT devices with a gateway onboard the UAV to save node battery life. Class A LoRa nodes on the ground transmit only when the UAV is expected to pass close to them; otherwise, they stay in the sleeping state most of the time. This paper provides a detailed description of the formulation of the synchronization protocol. The UAV’s flying dynamics have been considered for characterizing its speed and the time of visibility of each IoT sensor. Our model has allowed an analytical approach that can help to determine the best settings for LoRa transmissions. Finally, experiments have been carried out to assess the path loss attenuation, and a laboratory setup of the synchronization protocol has been implemented for the preliminary validation of our scheme.


Introduction
The increasing technical innovations of the last few years have allowed new opportunities and applications for the Internet of Things (IoT), and the advent of Low-Power Wide-Area Network (LPWAN) technologies has facilitated massive access to IoT nodes [1]. The IoT is becoming extremely popular in agriculture and environmental monitoring, where smart agriculture applications can improve sustainability and give farms an economic return of up to 25% of the harvest. For this reason, nowadays, many sensors are used for smart agriculture applications, and the trend is increasing. For instance, moisture sensor monitoring is particularly useful in understanding irrigation needs: when soil moisture is below a certain level, water can be provided through the activation of local irrigation actuators connected with sensor nodes, allowing for more efficient irrigation and greater sustainability and reducing human intervention.
When IoT devices are deployed in remote and rural areas, a significant criticality is the lack of Internet connectivity and local power supply. This issue can be overcome by adopting low-power, long-range radio communications using an IoT Gateway (GW) onboard an aerial node, a so-called Unmanned Aerial Vehicle (UAV). The UAV is envisaged to periodically pass over the IoT sensors' area in order to collect data measurements and to forward them to the Internet.
Although there are several LPWAN technologies, in this study, we focus on LoRa because this low-power communication technology can allow devices to communicate with other nodes kilometers away, lasting several years without battery replacements. Furthermore, LoRa allows work to be conducted on an open-source Medium Access Control (MAC) layer (specified as LoRaWAN) to implement new protocol solutions or other specific scenario-based upgrades. This paper deals with the communication of ground IoT nodes with a GW placed onboard a UAV passing in their proximity. This work also proposes an opportunistic protocol to synchronize the ground node transmission with the UAV pass, thus enabling the node to stay in the sleeping state most of the time and save energy. This solution can coordinate node transmissions in order to avoid collisions, a key feature in the perspective of a future massive deployment of sensor nodes. This work includes a study on propagation to assess the path loss attenuation when sensors are close to the ground. Moreover, an analytical model has allowed us to identify the best physical layer settings of the LoRa for the opportunistic scheme in terms of the probability that a sensor can communicate with the UAV during its visibility interval. This synchronization protocol has also been tested in the laboratory.
The present work extends the study of the same authors in [2] by including significant improvements as follows: (i) the UAV flight dynamics and wind conditions have been considered; (ii) an analytical approach is developed to evaluate the impact of synchronization; and (iii) a preliminary laboratory setup has been presented to validate our scheme with LoRa devices. This paper is organized as follows. Section 2 introduces the LoRa/LoRaWAN technology, describing the use of UAVs in LoRa systems and providing a literature survey. Our UAV-based system is then described in Section 3, while Section 4 deals with the opportunistic protocol designed to manage the communication between ground nodes and the UAV. Section 5 analyzes the probability that the sensors can communicate with the UAV passing over them. Experimental results regarding path loss attenuation for a rural area and test validation of the opportunistic protocol are presented in Section 6, and discussion on the achieved results, lessons learned, and open issues are provided in Section 7. Finally, Section 8 outlines the concluding remarks.

Background
This section provides an overview of enabling communication technologies (primarily focused on LPWAN solutions) and systems for mobile coverage of remote areas based on UAVs. Furthermore, it reports state-of-the-art solutions for opportunistic communications between on-field sensor nodes and moving GWs.

Selection of LPWAN Communication Technology
The Third Generation Partnership Project (3GPP) solution for IoT radio communications is based on the NB-IoT, recently included in Release 17 for Non-Terrestrial Networks (NTN) [3]. The NB-IoT uses a subset of the well-known Long-Term Evolution (LTE) technological features while limiting its operation to a single carrier bandwidth of 180 kHz (narrowband technology). By applying the NB-IoT to our scenario, a cell of coverage has to be irradiated by the UAV, similarly to a base station. IoT nodes and the GW can transmit power levels up to 20 dBm or more. Although the NB-IoT serves higher-value IoT markets interested in very low latency and high quality of service, it is not open source, and its deployment is limited by base station coverage, making it unsuitable for remote regions [1]. Similar considerations apply to LTE-cat M technology, which still relies on cellular base stations; moreover, in case of congestion, the Cat-M IoT device can be forced to disconnect from the network and be allowed to re-attach at a more favorable time. As an alternative, Sigfox provides terrestrial cellular-like coverage for IoT applications, but this system requires its proprietary network. An entirely open solution can be offered by weightless wireless technology, running in the unused UHF sub-GHz TV unlicensed spectrum; however, it has not achieved great popularity and few hardware implementations are available.
In this work, we adopt the long-range and low-power technology provided by LoRa with a LoRaWAN open source MAC layer.

Use of UAVs and Communications with IoT Nodes
In 3GPP, there is great momentum nowadays on NTN as a component of 5G systems and beyond. Not only UAVs but also High-Altitude Platform (HAP) stations (18-21 km of altitude) and Low-Earth Orbit (LEO) satellites (500-2000 km altitude) are valid solutions to communicate with ground IoT sensor nodes [9,10]. Here, we focus on using UAVs since they can be flexibly deployed where needed and represent cheaper solutions. In addition, they stay closer to the ground, thus facilitating the link budget with low-power IoT nodes on the field. Consequently, the system is more energy efficient and increases the battery lifetime of the IoT nodes [11]. UAVs can be classified according to three categories with different features, as shown in Figure 2. Rotary-wing UAVs are equipped with vertical lift rotors, allowing them to hover in the air. They are ideal for collecting videos and images or distributing treatments in smart agriculture. Fixed-wing UAVs are similar to common airplanes; they need a launch pad for take-off. Fixed-wing UAVs allow for reduced battery consumption and cover longer distances. The third category, hybrid UAVs, is a mix of fixed-and rotary-wing UAVs, having the ability to switch between the two flying modes.

Use of UAVs and Communications with IoT Nodes
In 3GPP, there is great momentum nowadays on NTN as a component of 5G systems and beyond. Not only UAVs but also High-Altitude Platform (HAP) stations (18-21 km of altitude) and Low-Earth Orbit (LEO) satellites (500-2000 km altitude) are valid solutions to communicate with ground IoT sensor nodes [9,10]. Here, we focus on using UAVs since they can be flexibly deployed where needed and represent cheaper solutions. In addition, they stay closer to the ground, thus facilitating the link budget with low-power IoT nodes on the field. Consequently, the system is more energy efficient and increases the battery lifetime of the IoT nodes [11]. UAVs can be classified according to three categories with different features, as shown in Figure 2. Rotary-wing UAVs are equipped with vertical lift rotors, allowing them to hover in the air. They are ideal for collecting videos and images or distributing treatments in smart agriculture. Fixed-wing UAVs are similar to common airplanes; they need a launch pad for take-off. Fixed-wing UAVs allow for reduced battery consumption and cover longer distances. The third category, hybrid UAVs, is a mix of fixedand rotary-wing UAVs, having the ability to switch between the two flying modes. Several modules are necessary inside a UAV: propeller(s), engine(s), flight control board, radio transmitter and receiver modules, a rechargeable battery or a tank in the case of a fuel engine, and a Global Navigation Satellite Systems (GNSS) module [12]. The UAV can be programmed to scan a specific area for agriculture and environmental monitoring applications [13] through a waypoint-based pre-determined path. The acquired measurements from sensors can be communicated to the LoRa server by adopting different technologies: with a 5G terrestrial gNodeB covering the scanned areas, through satellite com- Several modules are necessary inside a UAV: propeller(s), engine(s), flight control board, radio transmitter and receiver modules, a rechargeable battery or a tank in the case of a fuel engine, and a Global Navigation Satellite Systems (GNSS) module [12]. The UAV can be programmed to scan a specific area for agriculture and environmental monitoring applications [13] through a waypoint-based pre-determined path. The acquired measurements from sensors can be communicated to the LoRa server by adopting different technologies: with a 5G terrestrial gNodeB covering the scanned areas, through satellite communications, or by storing the data in the UAV memory and downloading them when the UAV returns to the starting point for landing/battery recharging.

Literature Survey
There is common use in the literature of LoRa transceivers for IoT applications, as in [14], which provides a comprehensive review of practices and strategies for sustainable and energy-efficient IoT technologies.
The work in [15] investigates current practices, challenges, and policies related to IoT network implementation. It discusses power consumption related to data centers, sensor nodes, and machine-to-machine communications, thus evaluating the threat of e-waste to the environment.
Reference [16] introduces a novel energy-efficient routing criterion for a smart grid environment. It adopts LoRa nodes implementing optimal channel and path selection techniques, thus obtaining a lower energy consumption than other routing protocols such as Low-Energy Adaptive Clustering Hierarchy (LEACH), Stable Election Protocol (SEP), and Distributed Energy Efficient Clustering (DEEC).
In [17], different WiFi-based sensor network configurations are examined for soil monitoring to identify the effects of the rural environment on the signal; propagation tests were performed which adopted three different types of testbeds (i.e., a grass field with low vegetation and regular terrain, a thicket with irregularities, a field of citrus) with on-ground, near-ground, and above-ground receiver placements. The maximum theoretical coverage was obtained for each configuration, showing that vegetation introduces high variability, especially in the presence of high foliage density.
The work in [18] proposes a LoRa sensor network for monitoring water quality in coastal areas. The adopted approach has been tested in a real environment to check the operativity of the sensors and architecture. However, this work does not implement scenarios involving real UAVs, but introduces a related opportunistic protocol and on field measurements related to an UAV emulated scenario.
The paper in [19] uses a LoRa transceiver of the SX1276 type. There is mobility between the end node (sensor) and LoRa GW. The authors adapted an existing open source firmware, called SX1276 Generic Ping-Pong, so the GW can send a customized beacon to advise about its reachability. These authors use SF = 12 and consider a 250 m connectivity radius with a transmission power of 14 dBm in the presence of vegetation. The approach proposed in this work implies that the sensor node transceiver stays awake to receive the ping message from the occasional pass of the GW. This approach is inefficient and could drain the node battery quickly.
Reference [20] proposes an opportunistic multi-hop routing protocol for LoRa-based intermittently connected networks called LoRaOpp. This solution envisages various setup scenarios but is not focused on using GWs on UAVs. This paper considers multi-hop data exchange between nodes and between the nodes and the GW, including the use of several techniques to minimize the number of forwarded packets in the network.
The work in [21] presents a data collection platform for smart cities that envisages mobile and fixed nodes equipped with WiFi and LoRa interfaces to forward packets in intermittently connected networks. This platform involves node sensors, sink stations connected to a fixed network, and mobile devices functioning as relays between nodes and sink stations. Specifically, this platform employs an alternative LoRa MAC protocol that leverages the presence of multiple sink stations in the network.
A scheme to coordinate the sensor transmission with the pass of the flying GW is to use the Wake-up Radio (WuR) technology [22]. WuR is a secondary always-on Ultra-Low Power (ULP) radio subsystem connected to the main node. The WuR continuously listens to the channel while the main radio is in sleeping mode. When a specific signal called a Wake-Up Beacon (WUB) is received, the WuR wakes up the main radio through an interruption. Thus, the WuR approach allows for an asynchronous wake-up of the main node with low latency. As LoRa and WuR present orthogonal features (long range with LoRa and short range with WuR), recent works have proposed combining these technologies on the same device to achieve energy efficiency and reduce latency. Typically, only the ULP WuR is always-on and listening to the channel, while the other components are in power-saving (sleep) mode. With this approach, the WuR range is very limited (about 120 m): in our case, the UAV should fly closer to the ground so that the nodes can receive its WUB. This constraint poses some limitations because it is more efficient to have the UAV flying at higher altitudes since the propagation conditions are better, and the UAV can cover a larger area with longer visibility intervals.
The paper in [23] adopts a rotary-wing UAV for a forest monitoring system based on LoRa. Each ground node hosts multiple sensors (temperature, light, and humidity). The LoRa GW is hosted on a UAV, which is connected to the network via WiFi or 4G systems, and it is expected to hover and collect data from the sensors of the covered area. The sensor node is always active in receiving mode and performs a network join procedure and a signaling handshake to transmit the data each time the UAV covers it. The node recognizes the arrival of the UAV that sends a beacon signal. Our system adopts a more efficient approach, where the LoRa node is in the sleeping state for most of the time, keeping all the benefits of the low-power LoRa transmissions also in case of communication with a UAV.
The main contributions of the works discussed above are summarized in Table 1.

Ref. Description
Advantages Disadvantages [14] Review of energy-efficient practices and strategies for sustainable IoT Comprehensive review of solutions Not related to GW mobility [15] Investigation of current practices, challenges, and policies related to LPWAN Discussion on threats of e-waste related to IoT data centers, sensor nodes, and machine-to-machine communications Not related to GW mobility [16] Novel energy-efficient routing scheme for a smart grid environment Improvement in energy consumption with respect to other routing protocols Not related to GW mobility [17] WiFi-based IoT network configurations for soil monitoring Propagation tests performed by adopting different vegetation conditions Not related to GW mobility, WiFi-based [18] LoRa sensor network for water quality monitoring in coastal areas Proof-of-concept tested in a real environment Not related to GW mobility [19] Customized beacon sent by a moving GW to announce its reachability Asynchronous communications Awake transceiver node to receive ping messages [20] Opportunistic multi-hop routing protocol for LoRa-based intermittently connected networks Support for multi-hop data exchange Not using a GW on UAVs [21] Mobile and fixed nodes equipped with WiFi and LoRa Management of multiple sink stations in the network Use of WiFi (no low-power) [22] A secondary Wake-up Radio always scanning for devices Asynchronous wake-up of the main node with low latency Short-range link, limiting the UAV flying altitude [23] Monitoring system for a forest based on LoRa and UAV Asynchronous communications Sensor node always active in receiving mode

System Description
The operating context refers to a rural/remote area without network connectivity to support an IoT network, where data transmission is obtained through the adoption of a LoRa GW onboard a flying UAV. Specifically, the objective is to monitor a rural area along a river or other 'linear' infrastructures (e.g., pipelines), assuming the use of a fixed-wing UAV to perform this task, as there is no need for hovering functions, only to scan a specific We have selected a reference location in Tuscany (close to Florence) and determined the wind speed and direction statistics at 120 m of altitude to be suitable for UAV flight. Data have been taken from the Wind Atlas [24] and are shown in Figure 3 below. The UAV route is predefined to follow waypoints. The UAV flight is controlled by an autopilot (Guidance, Navigation and Control system, GN&C) that is reproduced in our study by the UAV Toolbox provided by Matlab (fixed-wing case) [25,26]. This tool allows the simulation of the UAV, considering the flight dynamics and the effects of winds. In its flight, the UAV visits each waypoint with a tolerance of about ±50 m [27]. Figure 4 shows our UAV path based on waypoints and considering the three wind cases of our reference scenario and the UAV having to monitor the IoT sensors distributed along a river. If the sensors are deployed more sparsely, a UAV path optimization algorithm has to be adopted to select the shortest path to reach all of them; this is not the present case, since the sensors are deployed along a river modeled by linear segments. The presence of the winds modifies the actual UAV speed even if the controller onboard counteracts their effects and is set to a nominal UAV speed denoted as vd = 70 km/h. The results obtained from the Matlab UAV Toolbox simulator for the time needed to cover our path are 426 s, 422 s, and 398 s for the red, blue, and green wind cases, respectively.
Let us refer to the position of an exemplary sensor along the UAV path, as shown in Figure 4. The UAV will start to be visible for this sensor when it reaches position A and ends its visibility interval at point B. The distance from A to B is 2R, where R is the coverage radius for the sensor node. The wind conditions affect the time when the UAV is at the minimum distance from the i-th sensor, Tc,i, and the interval for which the UAV is visible to the sensor, Δv(SF), where SF is the adopted spreading factor, SF Î {7, 8, 9, 10, 11, 12}. In nominal conditions without winds, we have: where x denotes the distance of the sensor node position from the projection of the UAV path on the ground. The coverage R = R(SF) will be characterized later in this section based on a LoRa link budget. The UAV can receive the transmissions of a sensor if it is within the coverage radius R(SF) and inside its UAV visibility interval Δv(SF) (1). For our reference location, we have selected the two strongest wind conditions and neglected all the other cases for which we refer to the ideal condition of no winds. Then, according to Figure 3, we have the following wind statistics:

•
Case 1: Average wind speed of 6.5 m/s from NNE for 25% of the time (UAV path shown in red in Figure 4); • Case 2: Average wind speed of 6.5 m/s from WSW for 16% of the time (UAV path shown in blue in Figure 4); • Case 3: Negligible wind speed for 59% of the time (UAV path shown in green in Figure 4).
The UAV route is predefined to follow waypoints. The UAV flight is controlled by an autopilot (Guidance, Navigation and Control system, GN&C) that is reproduced in our study by the UAV Toolbox provided by Matlab (fixed-wing case) [25,26]. This tool allows the simulation of the UAV, considering the flight dynamics and the effects of winds. In its flight, the UAV visits each waypoint with a tolerance of about ±50 m [27]. Figure 4 shows our UAV path based on waypoints and considering the three wind cases of our reference scenario and the UAV having to monitor the IoT sensors distributed along a river. If the sensors are deployed more sparsely, a UAV path optimization algorithm has to be adopted to select the shortest path to reach all of them; this is not the present case, since the sensors are deployed along a river modeled by linear segments. The presence of the winds modifies the actual UAV speed even if the controller onboard counteracts their effects and is set to a nominal UAV speed denoted as v d = 70 km/h. The results obtained from the Matlab UAV Toolbox simulator for the time needed to cover our path are 426 s, 422 s, and 398 s for the red, blue, and green wind cases, respectively.
Let us refer to the position of an exemplary sensor along the UAV path, as shown in Figure 4. The UAV will start to be visible for this sensor when it reaches position A and ends its visibility interval at point B. The distance from A to B is 2R, where R is the coverage radius for the sensor node. The wind conditions affect the time when the UAV is at the minimum distance from the i-th sensor, T c,i , and the interval for which the UAV is visible to the sensor, ∆ v (SF), where SF is the adopted spreading factor, SF Î {7, 8, 9, 10, 11, 12}. In nominal conditions without winds, we have: where x denotes the distance of the sensor node position from the projection of the UAV path on the ground. The coverage R = R(SF) will be characterized later in this section based on a LoRa link budget.  Let us recall that Tc,i denotes the time when the UAV reaches the closest point along its path from the i-th sensor node; this time is at the center of the UAV visibility interval for the i-th node. Table 2 shows the central visibility time Tc,i and the actual UAV speed v for the exemplary sensor in Figure 4; the impact of the wind conditions on Tc,i and v is evident. Table 2. Time to reach our exemplary sensor in Figure 4 after leaving the origin and the related UAV speed for the different wind conditions with SF = 7. Figure 4 Central Referring to our scenario in Figure 4, Figure 5 shows the distribution (histogram) of the resulting UAV speed v as a result of the nominal cruise speed of 70 km/h and the effects of our wind conditions along the path. We can notice the peak caused by the nominal cruise speed of 70 km/h when there are no winds (case 3 above), with a probability of 59%. The effects of the winds in cases 1 and 2 cause an alteration in the UAV's speed, and thus the UAV speed values range from 50 to 90 km/h. In our theoretical study, we will model the UAV speed's probability density function fv(v) as a combination of a uniform distribution from vmin = 50 to vmax = 90 km/h and a discrete value at the nominal speed vd of The UAV can receive the transmissions of a sensor if it is within the coverage radius R(SF) and inside its UAV visibility interval ∆ v (SF) (1).

Exemplary Sensor in
Let us recall that T c,i denotes the time when the UAV reaches the closest point along its path from the i-th sensor node; this time is at the center of the UAV visibility interval for the i-th node. Table 2 shows the central visibility time T c,i and the actual UAV speed v for the exemplary sensor in Figure 4; the impact of the wind conditions on T c,i and v is evident. Table 2. Time to reach our exemplary sensor in Figure 4 after leaving the origin and the related UAV speed for the different wind conditions with SF = 7. Figure 4 Central Referring to our scenario in Figure 4, Figure 5 shows the distribution (histogram) of the resulting UAV speed v as a result of the nominal cruise speed of 70 km/h and the effects of our wind conditions along the path. We can notice the peak caused by the nominal cruise speed of 70 km/h when there are no winds (case 3 above), with a probability of 59%. The effects of the winds in cases 1 and 2 cause an alteration in the UAV's speed, and thus the UAV speed values range from 50 to 90 km/h. In our theoretical study, we will model the UAV speed's probability density function f v (v) as a combination of a uniform distribution from v min = 50 to v max = 90 km/h and a discrete value at the nominal speed v d of 70 km/h as follows:

Exemplary Sensor in
where v is the UAV's effective flight speed in km/h, δ(v) is the Delta Dirac function centered at 0, and rect(v) is the unitary rectangular function from −0.5 to 0.5. Note that the term (1) is related to the nominal UAV speed v d corresponding to case 3 with a probability of 59%. (1) is related to the nominal UAV speed vd corresponding to case 3 with a probability of 59%. The signal to and from the UAV is affected by many scattering obstacles (e.g., buildings, trees). The signal received is the composition of many waves, including Line of Sight (LoS), reflected path, diffracted path, and scattering. These effects depend on the environment, the carrier frequency, and the UAV's altitude. All these elements (commonly identified as clutter terms) cause the path loss attenuation to deviate from the free space or the two-ray models [28]. Even if the path loss model for our specific rural area case is studied in Section 6, we prefer to adopt a more general path loss model based on the work in [29], including an additional attenuation due to trees and foliage of 10 dB [30]. The resulting long-distance (large time-scale) path loss model depends on the distance d as follows: where, for LoS conditions, we consider ( ) = 116 dB for = 1 km, γ = 3, and = 10 dB. In non-LoS conditions, we should consider an additional path loss attenuation term of 10-20 dB.
We refer to a UAV flying at an altitude H = 120 m (the limit value for the open flight category by the European Union Aviation Safety Agency, EASA [31]) and a GW receiver (LoRa SX 1276) with sensitivity S = {−124, −127, −130, −133, −135, −137} dBm for SF ∈ {7, 8, 9, 10, 11, 12}, respectively, with a 125 kHz bandwidth [32]. We consider omnidirectional antennas on both the transmitter and receiver (antenna gains Gtx = Grx = 0 in dBi) with connector and cabling losses Lcon = 2 dB. Let Pt denote the sensor transmission power. We consider connectivity to be achieved if the following condition is met: The signal to and from the UAV is affected by many scattering obstacles (e.g., buildings, trees). The signal received is the composition of many waves, including Line of Sight (LoS), reflected path, diffracted path, and scattering. These effects depend on the environment, the carrier frequency, and the UAV's altitude. All these elements (commonly identified as clutter terms) cause the path loss attenuation to deviate from the free space or the two-ray models [28]. Even if the path loss model for our specific rural area case is studied in Section 6, we prefer to adopt a more general path loss model based on the work in [29], including an additional attenuation due to trees and foliage of 10 dB [30]. The resulting long-distance (large time-scale) path loss model depends on the distance d as follows: where, for LoS conditions, we consider L(d 0 ) = 116 dB for d 0 = 1 km, γ = 3, and L veg = 10 dB.
In non-LoS conditions, we should consider an additional path loss attenuation term of 10-20 dB. We refer to a UAV flying at an altitude H = 120 m (the limit value for the open flight category by the European Union Aviation Safety Agency, EASA [31]) and a GW receiver (LoRa SX 1276) with sensitivity S = {−124, −127, −130, −133, −135, −137} dBm for SF ∈ {7, 8, 9, 10, 11, 12}, respectively, with a 125 kHz bandwidth [32]. We consider omnidirectional antennas on both the transmitter and receiver (antenna gains G tx = G rx = 0 in dBi) with connector and cabling losses L con = 2 dB. Let P t denote the sensor transmission power. We consider connectivity to be achieved if the following condition is met: where M is a margin to protect the transmission from typical shadowing effects caused by obstacles along the path from the transmitter and receiver; we typically assume M = 10 dB for a safe link budget. The coverage radius R is the maximum value of d satisfying the condition in (4) that the received power is above the sensitivity threshold for the corresponding SF: Note that we compute R in (5) referring to the uplink transmission (i.e., from sensors to the UAV), but we also apply it to the downlink, assuming that the uplink case is more critical. Figure 6 shows the maximum range R(SF) and the corresponding maximum ∆ v (SF) for x = 0 as functions of the sensor transmission power P t in dBm for SF = 7 and 10. Figure 7 provides a similar graph but having R(SF) and ∆ v (SF) as functions of SF for sensor transmission power P t = 3 and 6 dB. For instance, with P t = 6 dBm, we obtain R = 500 m for SF = 7 and R = 1100 m for SF = 10. Correspondingly, the maximum UAV visibility time for a sensor on the ground is ∆ v = 55 s for SF = 7 and 125 s for SF = 10 with nominal UAV speed conditions. The radius R and the visibility interval ∆ v can be improved by increasing the SF value and/or the transmission power level P t . where M is a margin to protect the transmission from typical shadowing effects caused by obstacles along the path from the transmitter and receiver; we typically assume M = 10 dB for a safe link budget. The coverage radius R is the maximum value of d satisfying the condition in (4) that the received power is above the sensitivity threshold for the corresponding SF: Note that we compute R in (5) referring to the uplink transmission (i.e., from sensors to the UAV), but we also apply it to the downlink, assuming that the uplink case is more critical. Figure 6 shows the maximum range R(SF) and the corresponding maximum Δv(SF) for x = 0 as functions of the sensor transmission power Pt in dBm for SF = 7 and 10. Figure  7 provides a similar graph but having R(SF) and Δv(SF) as functions of SF for sensor transmission power Pt = 3 and 6 dB. For instance, with Pt = 6 dBm, we obtain R = 500 m for SF = 7 and R = 1100 m for SF = 10. Correspondingly, the maximum UAV visibility time for a sensor on the ground is Δv = 55 s for SF = 7 and 125 s for SF = 10 with nominal UAV speed conditions. The radius R and the visibility interval Δv can be improved by increasing the SF value and/or the transmission power level Pt.  To complete the signal propagation characterization, we consider the probability of LoS for the communication between ground nodes and the UAV, PLoS. This probability is essential because the path loss model in (3) can only be applied in LoS conditions. According to [33], PLoS can be expressed by a sigmoid-type function as follows: where is the elevation angle in degrees of the communication between the ground sensor node and the UAV, and a and b are coefficients (we consider = 5 and = 0.3 for suburban and rural areas [33]). In our study, the value of for a sensor depends on the relative position of the UAV that changes with time because the UAV moves along its path. An example of the derivation for our case will be provided in Section 5.

Synchronization Protocol for Opportunistic Communications between GW and IoT Nodes
This section describes the proposed synchronization protocol that enables LoRa devices to communicate opportunistically with the GW on the UAV to increase energy efficiency. A key point to implement reliable communications between the flying GW (onboard the UAV) and end nodes is the capability for the end nodes to be in sending/receiving mode when the UAV is within the communication range. This task could be easily achieved by implementing a LoRa Class C node, which is always on, so it can transmit and receive information at any instant. However, this class of devices is intended for actuators or power-supplied sensors due to their high energy consumption [7]. One of the key innovations of this work is the adoption of LoRa Class A sensors for this task, allowing a very low power consumption (for instance, from 30 to 220 times lower than Class C sensors with SF = 7 [7]). To reach this goal, we envisage simple LoRaWAN modifications to support the synchronization of the ground node transmissions with the UAV pass time; To complete the signal propagation characterization, we consider the probability of LoS for the communication between ground nodes and the UAV, P LoS . This probability is essential because the path loss model in (3) can only be applied in LoS conditions. According to [33], P LoS can be expressed by a sigmoid-type function as follows: where ϑ is the elevation angle in degrees of the communication between the ground sensor node and the UAV, and a and b are coefficients (we consider a = 5 and b = 0.3 for suburban and rural areas [33]). In our study, the value of ϑ for a sensor depends on the relative position of the UAV that changes with time because the UAV moves along its path. An example of the derivation ϑ for our case will be provided in Section 5.

Synchronization Protocol for Opportunistic Communications between GW and IoT Nodes
This section describes the proposed synchronization protocol that enables LoRa devices to communicate opportunistically with the GW on the UAV to increase energy efficiency. A key point to implement reliable communications between the flying GW (onboard the UAV) and end nodes is the capability for the end nodes to be in sending/receiving mode when the UAV is within the communication range. This task could be easily achieved by implementing a LoRa Class C node, which is always on, so it can transmit and receive information at any instant. However, this class of devices is intended for actuators or power-supplied sensors due to their high energy consumption [7]. One of the key innovations of this work is the adoption of LoRa Class A sensors for this task, allowing a very low power consumption (for instance, from 30 to 220 times lower than Class C sensors with SF = 7 [7]). To reach this goal, we envisage simple LoRaWAN modifications to support the synchronization of the ground node transmissions with the UAV pass time; in particular, we propose an opportunistic protocol that enables node transmission only when needed and keeps the sensor node in the sleeping state for the rest of the time to save battery energy.
In the following, the description of the opportunistic protocol is provided. We are considering a single-channel GW on the UAV. We assume all the sensors transmit using the same LoRa SF value. The node position can be mapped during the deployment phase. Then, the node's first transmission timing T 0s,i (corresponding to the time when the UAV is expected to reach the i-th sensor according to the first planned flight route with nominal speed v d ) can be calculated using the Matlab UAV toolbox (Section 3) and pre-set in this sensor node. The node location is determined at the time of installation without needing a GPS module on the node (sensors are deployed in fixed locations). However, in the case of moving sensors (i.e., livestock monitoring, etc.), each node could also be equipped with a GPS module at the cost of extra energy consumption. The initial (i.e., "first round") transmission timing T 0s,i is initialized in the node firmware to schedule its first transmission in the middle of the related UAV coverage time interval ∆ v,i , thus achieving better margins if some variations from nominal conditions occur. In this way, the probability of LoS at the transmission time is maximized because the sensor transmits when the UAV is visible with the maximum elevation angle.
Our system is based on a route management algorithm composed of route planning and a UAV flight model. It defines the route and the expected transmission time for each sensor node to keep the synchronism with the next UAV pass. In this work, we are not interested in studying route optimization schemes. We consider the nodes along a river modeled by linear segments (we set the waypoints accordingly). A further study of route optimization is beyond the scope of the present paper, which is concerned with investigating the synchronization of sensor transmissions with the UAV pass. This route management algorithm is carried out based on the knowledge of sensor nodes' positions and uses a UAV flight simulator (Matlab UAV Toolbox, fixed-wing case) to take the effects of wind into account.
The UAV communicating with the sensor nodes expects to receive the measurements from node I at time T c,i . The ideal condition for the protocol is that the i-th sensor transmission time T s,i coincides with T c,i . However, we can lose this synchronism because of the following causes (see Figure 8):

1.
A shift in the UAV's departure time; 2.
Alteration in the UAV's flight speed with respect to the expected one because of wind variations; 4.
The UAV's autopilot precision and capability to reach the waypoints also in relation to the wind conditions.
• Hence, a synchronization scheme is envisaged where the UAV upgrades the i-th sensor transmission time at each pass. This is made possible using the ACK message as a reply to the measurement received by the UAV. The ACK message piggybacks the D i value for the sensor that represents an estimation of the time the sensor has to sleep before transmitting again for the next UAV pass; see the following Equation (7). The sensor receiving the ACK can then command its transceiver to enter a sleeping mode for time ∆ i to save energy. By adopting this protocol, a node remains in the sleeping state most of the time. The device wakes up just for the time needed to take a measurement from the field and transmit it when the UAV is expected to pass close to it.
The adopted scheme with synchronism is robust since the sensor transmission has a tolerance made possible by the UAV's visibility interval for the sensor with a duration ∆ vi (SF) according to (1). Therefore, the interval is long enough that the sensor transmission falls inside it to communicate with the UAV.
This system is adaptive, allowing changes in the UAV route. It is sufficient that the UAV sends the new D i value consistent with the new path (or even the new sensor scanning order) to implement the change for the next UAV scan pass. The system is also scalable because we can add new sensors and densify them provided that a minimum distance between sensors is kept (in this regard, see Equations (8) and (9)). • Hence, a synchronization scheme is envisaged where the UAV upgrades the i-th sensor transmission time at each pass. This is made possible using the ACK message as a reply to the measurement received by the UAV. The ACK message piggybacks the Di value for the sensor that represents an estimation of the time the sensor has to sleep before transmitting again for the next UAV pass; see the following Equation (7). The sensor receiving the ACK can then command its transceiver to enter a sleeping mode for time Δi to save energy. By adopting this protocol, a node remains in the sleeping state most of the time. The device wakes up just for the time needed to take a measurement from the field and transmit it when the UAV is expected to pass close to it.
The adopted scheme with synchronism is robust since the sensor transmission has a tolerance made possible by the UAV's visibility interval for the sensor with a duration Δvi (SF) according to (1). Therefore, the interval is long enough that the sensor transmission falls inside it to communicate with the UAV.
This system is adaptive, allowing changes in the UAV route. It is sufficient that the UAV sends the new Di value consistent with the new path (or even the new sensor scanning order) to implement the change for the next UAV scan pass. The system is also Let us formally determine the ∆ i value used by the synchronization algorithm carried out onboard the GW. We distinguish two cases: • Case a, when the next UAV pass is contiguous with the current one; • Case b, when the next UAV pass is carried out after an interruption due to the refueling or other reasons.
We consider T s,i as the transmission time set for the i-th sensor (for a generic transmission after the first one) according to the estimation of UAV speed and knowing the sensor coordinates and thus the corresponding distance from the origin of the UAV path. As for the T 0s,i value set in the sensor at the sensor node deployment, we assume a reference UAV route carried out for the first time starting at time t 0 (i.e., the time when the UAV starts to cover the path) at the nominal speed v d and covering a distance d i to reach the closest point with the i-th sensor along the path. For the sake of simplicity, we define T s,i and T 0s,i using t 0 = 0. We also use d i as the distance from the origin along the current route to reach the i-th sensor in contrast to d i,next , representing the new distance of the i-th sensor from the same UAV path origin because of a new route followed by the UAV at the next pass (d i,next = d i in case of no path change). We also consider v next as the expected UAV speed of the next UAV pass, which is estimated based on wind forecasts.
In Case a, we denote T i,residual_path as the estimated residual time to complete the path after reaching the i-th sensor, considering that the UAV must return to its origin (i.e., the starting point). This time is estimated onboard the UAV, knowing the current path characteristics and wind conditions when the i-th node is reached. In Case b, we also need to define the time the UAV will start the next route, T new (assuming that the UAV will have to stop between the current route and the new one). Therefore, ∆ i results as: where δ i = T c,i − T s,i is the synchronization error (see Figure 8). Figure 9 depicts the operational steps followed at both the end node and the GW by the synchronization (opportunistic) protocol. Several approaches can be implemented to cope with possible failed receptions of ACK messages that should update the timing of the next UAV pass. Here, two approaches have been proposed.
The first approach envisages the capability for the GW to include in its ACK the scheduled times for more next passes Δi so that if the i-th sensor cannot communicate with the UAV in the current pass, it already knows some coarse synchronism for the next UAV passes. This approach entails a tradeoff between communication robustness and flexibility in changing the UAV's route. Upon the next transmission, the sensor could communicate current and past measurements, thus requiring a larger payload.
The second approach envisages immediate data retransmission from the node when it does not receive the ACK within a maximum waiting window. This solution introduces a tradeoff between communication robustness and the spatial density of nodes. This is because the transmission interval needed by a node could be doubled or tripled for one or two retransmissions, thus reducing the maximum density of sensors, as will be explained in relation to the next formula (9). Finally, by enlarging the data transmission time, there is a larger probability that the sensor's transmission will not be completed before the UAV coverage is lost.
Let (Lp, SF) [ (LA, SF)] denote the transmission time of the packet (ACK) sent by a sensor node (GW) with a payload of Lp (LA) bytes and using spreading factor SF. To determine (Lp, SF) and (LA, SF), we need to make assumptions on the payload length for both the message sent by the sensor and the ACK sent by the GW (see Figure 10). Several approaches can be implemented to cope with possible failed receptions of ACK messages that should update the timing of the next UAV pass. Here, two approaches have been proposed.
The first approach envisages the capability for the GW to include in its ACK the scheduled times for more next passes ∆ i so that if the i-th sensor cannot communicate with the UAV in the current pass, it already knows some coarse synchronism for the next UAV passes. This approach entails a tradeoff between communication robustness and flexibility in changing the UAV's route. Upon the next transmission, the sensor could communicate current and past measurements, thus requiring a larger payload.
The second approach envisages immediate data retransmission from the node when it does not receive the ACK within a maximum waiting window. This solution introduces a tradeoff between communication robustness and the spatial density of nodes. This is because the transmission interval needed by a node could be doubled or tripled for one or two retransmissions, thus reducing the maximum density of sensors, as will be explained in relation to the next formula (9). Finally, by enlarging the data transmission time, there is a larger probability that the sensor's transmission will not be completed before the UAV coverage is lost.
Let T p (L p , SF) [T A (L A , SF)] denote the transmission time of the packet (ACK) sent by a sensor node (GW) with a payload of L p (L A ) bytes and using spreading factor SF. To determine T p (L p , SF) and T A (L A , SF), we need to make assumptions on the payload length for both the message sent by the sensor and the ACK sent by the GW (see Figure 10). Concerning the data packet, we account for 6-byte GPS coordinates (optional), a 6byte sensor ID, 14 available bytes for collecting multiple data from the node (multiple sensors, including battery status), and a 12-byte timestamp measurement. In conclusion, the packet payload is 38 bytes long; however, it could be reduced to 22 bytes (i.e., 6 bytes for node ID, 4 bytes for sensor data, 12 bytes for timestamp) when considering a single parameter measurement with nodes georeferenced during the installation phase (thus not needing to transmit their positions). Concerning the ACK message, its payload envisages the ID of the node where this ACK and the 12-byte time specification of the delay Δi for the next transmission are addressed, thus resulting in a total length of 18 bytes.
Based on these assumptions and using [34], the values of (Lp, SF) and (LA, SF) are provided in Table 3 for the different SF values, including in the ACK case. A minimum wake-up time of 5 s, Tw(SF), is used when it is not possible to detect an ACK in a receiver window. Figure 8 also shows that if there is a dense sensor deployment, adjacent nodes' coverage time intervals Δvi(SF) overlap. To avoid transmission collisions, two sensors need to be separated in their transmission times Ts,i for more than the sensor message transmission time (Lp, SF) plus the time to receive the ACK message from the GW, including the receiver delay window(s), . We have: where Treceiving phase in the worst case can be expressed as [35,36]:  Table 3. For instance, ( = 7) = 2077 ms.  (8) and (9), we can determine the minimum distance dmin among sensors along the path to avoid their transmissions colliding because of the imposed transmission synchronism. If the sensors are not exactly on the UAV's path, dmin is considered in relation to the distance of the pro- Concerning the data packet, we account for 6-byte GPS coordinates (optional), a 6-byte sensor ID, 14 available bytes for collecting multiple data from the node (multiple sensors, including battery status), and a 12-byte timestamp measurement. In conclusion, the packet payload is 38 bytes long; however, it could be reduced to 22 bytes (i.e., 6 bytes for node ID, 4 bytes for sensor data, 12 bytes for timestamp) when considering a single parameter measurement with nodes georeferenced during the installation phase (thus not needing to transmit their positions). Concerning the ACK message, its payload envisages the ID of the node where this ACK and the 12-byte time specification of the delay ∆ i for the next transmission are addressed, thus resulting in a total length of 18 bytes.
Based on these assumptions and using [34], the values of T p (L p , SF) and T A (L A , SF) are provided in Table 3 for the different SF values, including in the ACK case. A minimum wakeup time of 5 s, T w (SF), is used when it is not possible to detect an ACK in a receiver window.  Figure 8 also shows that if there is a dense sensor deployment, adjacent nodes' coverage time intervals ∆ vi (SF) overlap. To avoid transmission collisions, two sensors need to be separated in their transmission times T s,i for more than the sensor message transmission time T p (L p , SF) plus the time to receive the ACK message from the GW, including the receiver delay window(s), T receiving phase . We have: where T receiving phase in the worst case can be expressed as [35,36]: T receiving phase (SF) = T receiver delay1 + T w (SF)+T receiver delay2 +T A (L A SF) having T receiver delay1 = T receiver delay2 = 1 s. The other values are shown in Table 3. For instance, T receiving phase (SF = 7) = 2077 ms. Let us denote T tot (L, SF)= T p (L, SF) + T receiving phase (SF). Based on (8) and (9), we can determine the minimum distance d min among sensors along the path to avoid their transmissions colliding because of the imposed transmission synchronism. If the sensors are not exactly on the UAV's path, d min is considered in relation to the distance of the projections of the sensor node positions along the UAV path. We have: where v(v d , wind) denotes the actual UAV speed depending on the reference speed v d , the wind conditions, and the sensor position along the path. We need to take the maximum UAV speed at sensor node's position to consider the worst-case wind conditions. Figure 11 shows the time durations of sending data and the ACK reception (one communication session for each node), also providing the minimum distance d min = 42.8 m when the UAV flies at 70 km/h for SF = 7.
where ( , ) denotes the actual UAV speed depending on the reference speed vd, the wind conditions, and the sensor position along the path. We need to take the maximum UAV speed at sensor node's position to consider the worst-case wind conditions. Figure 11 shows the time durations of sending data and the ACK reception (one communication session for each node), also providing the minimum distance dmin = 42.8 m when the UAV flies at 70 km/h for SF = 7. If the dmin constraint is met in the sensor deployment on the ground, there are no collisions among sensor transmissions, thus increasing system efficiency; the results for dmin are shown in Figure 12, together with a parameter ( ) describing the robustness of the synchronization scheme for ground IoT nodes-to-UAV transmissions, defined as where ( ) is determined according to (1) and (5) with Pt = 6 dB and ( , ) specified in relation to (10). We can motivate the use of parameter ( ) in the following way: the synchronism will be more stringent if ( ) becomes smaller. If SF increases, v(SF) increases, ( , ) are becomes larger. The optimal condition for the synchronization protocol is when is at its maximum. The results in Figure 12 show that the best synchronism robustness η is achieved for SF = 10; this optimal condition is obtained at the expense of a larger dmin minimum distance between sensors with respect to the case with SF = 7. Nevertheless, we can consider that SF = 10 is the optimal choice for the design of our system. Further proof of the selection of SF = 10 will be provided in the next section dealing with the analysis of opportunistic connectivity. If the d min constraint is met in the sensor deployment on the ground, there are no collisions among sensor transmissions, thus increasing system efficiency; the results for d min are shown in Figure 12, together with a parameter η(SF) describing the robustness of the synchronization scheme for ground IoT nodes-to-UAV transmissions, defined as where ∆ v (SF) is determined according to (1) and (5) with P t = 6 dB and T tot (L, SF) specified in relation to (10). We can motivate the use of parameter η(SF) in the following way: the synchronism will be more stringent if η(SF) becomes smaller. If SF increases, ∆ v (SF) increases, T tot (L, SF) are becomes larger. The optimal condition for the synchronization protocol is when η is at its maximum. The results in Figure 12 show that the best synchronism robustness η is achieved for SF = 10; this optimal condition is obtained at the expense of a larger d min minimum distance between sensors with respect to the case with SF = 7. Nevertheless, we can consider that SF = 10 is the optimal choice for the design of our system. Further proof of the selection of SF = 10 will be provided in the next section dealing with the analysis of opportunistic connectivity.
As for energy consumption with the synchronization protocol, the power consumption for the LoRa transceiver can be characterized by the current intensity levels in the different states (i.e., transmit, receive, idle, and sleep) and the duration of such states [32], as depicted in Figure 13. Based on the work in [7], where the power consumption of the LoRa transceiver is detailed, it is possible to obtain a duration of about 20 years with a common 2000 mAh battery with SF = 7, P t = 14 dBm and one packet transmission per hour with a packet size between 25 and 50 bytes. For more details and more cases, the interested reader may refer to [7]. As for energy consumption with the synchronization protocol, the power consumption for the LoRa transceiver can be characterized by the current intensity levels in the different states (i.e., transmit, receive, idle, and sleep) and the duration of such states [32], as depicted in Figure 13. Based on the work in [7], where the power consumption of the LoRa transceiver is detailed, it is possible to obtain a duration of about 20 years with a common 2000 mAh battery with SF = 7, Pt = 14 dBm and one packet transmission per hour with a packet size between 25 and 50 bytes. For more details and more cases, the interested reader may refer to [7].

Analysis of the Communication Opportunity between an IoT Node and the UAV
This section analyzes the synchronization issues in terms of the probability that the UAV correctly receives a measure sent by a node on the ground. The reference transmission time (with nominal UAV speed vd and nominal UAV departure time t0 = 0) for the generic i-th sensor is T0s,i = . Considering that the UAV has an actual speed v that depends on the wind conditions, the i-th sensor is covered by the UAV in the following time interval of duration Dvi from ( ) + to ( ) + , where denotes the time error in the UAV's launch. In relation to (1), we have adopted the following notation: K(SF) =  As for energy consumption with the synchronization protocol, the power consumption for the LoRa transceiver can be characterized by the current intensity levels in the different states (i.e., transmit, receive, idle, and sleep) and the duration of such states [32], as depicted in Figure 13. Based on the work in [7], where the power consumption of the LoRa transceiver is detailed, it is possible to obtain a duration of about 20 years with a common 2000 mAh battery with SF = 7, Pt = 14 dBm and one packet transmission per hour with a packet size between 25 and 50 bytes. For more details and more cases, the interested reader may refer to [7].

Analysis of the Communication Opportunity between an IoT Node and the UAV
This section analyzes the synchronization issues in terms of the probability that the UAV correctly receives a measure sent by a node on the ground. The reference transmission time (with nominal UAV speed vd and nominal UAV departure time t0 = 0) for the generic i-th sensor is T0s,i = . Considering that the UAV has an actual speed v that depends on the wind conditions, the i-th sensor is covered by the UAV in the following time interval of duration Dvi from ( ) + to ( ) + , where denotes the time error in the UAV's launch. In relation to (1), we have adopted the following notation: K(SF) =

Analysis of the Communication Opportunity between an IoT Node and the UAV
This section analyzes the synchronization issues in terms of the probability that the UAV correctly receives a measure sent by a node on the ground. The reference transmission time (with nominal UAV speed v d and nominal UAV departure time t 0 = 0) for the generic i-th sensor is T 0s,i = d i v d . Considering that the UAV has an actual speed v that depends on the wind conditions, the i-th sensor is covered by the UAV in the following time interval of duration D vi from where t s denotes the time error in the UAV's launch. In relation to (1), we have adopted the following notation: We model time t s according to a zero-mean Gaussian random variable with standard deviation s s ; let N(0, σ s ) denote the corresponding probability density function. For numerical evaluations, we consider s s = 20 s. Moreover, the UAV speed v is modeled according to the density function f v (v) in (2).
The i-th sensor node transmits successfully if T 0s,i + T tot (L, SF) is within the interval of duration D vi . Then, suppose the transmissions of the sensors are kept at times T 0s,i without alterations to take the actual UAV speed into account. In that case, transmissions are successful according to probability P s (d i , SF), characterized as follows: We have two conditions in (12) that characterize the "event visibility" V i of the i-th node: the first is that the starting transmission time is within the UAV visibility time; the second is that the visibility time also includes the time to receive the ACK. Elaborating on the conditions in (12), we have: With our numerical settings, it is possible to prove that we have Then, based on (14), the condition that characterizes the probability in (13) can be simplified as follows: To determine (15), we condition on the v value and remove the conditioning using the probability density function f v (v) in (2): Through some elaborations, we obtain the following result: We consider that this probability decorrelates at multiple passes of the UAV close to the i-th sensor. Hence, if we have two subsequent passes of the UAV close to the i-th node (see Figure 4), the probability of communicating correctly with the i-th sensor in at least one of the two passes P s,2passes (d i , SF) can be expressed as: Figure 14 provides the analytical results for P s (d i , SF) and P s2passes (d i , SF) numerically determined for P t = 6 dB, x = 5 m, and SF values of 7 and 10 as functions of the distance d i of the sensor node along the path. This graph also contains the results in the case of no wind (the ideal situation with v = v d ) when (17) is simplified as follows: results than SF = 7. In particular, with SF = 10, the probability of success in a single pass ( , ) is 77% at 1 km and decreases to 60% at 5 km. However, with two passes, we obtain much better results with a 94% probability of success at 1 km and an 85% probability of success at 5 km. The results improve and are close to 96% at any distance di if we consider two UAV passes without winds or using our synchronization method. These results motivate the adoption of our proposed synchronization protocol. In our study, we can determine PLoS at the transmission time of the generic sensor at distance di along the UAV's path. In our model, the nominal transmission time for the sensor at distance di along the UAV's route is set to time , , assuming that the UAV ideally starts to scan its path at time t0 = 0. The UAV flies with actual speed v and a departure time offset from time t0 = 0 equal to ts. Then, the distance covered by the UAV along its route at the sensor transmission time is yUAV( , ), calculated as: Based on our assumptions, the generic i-th sensor transmits when the UAV is at a distance , − with respect to the UAV's nominal position di. Since this sensor is at a distance x from the path and the UAV flies at an altitude H, we can determine the elevation angle ( ) as follows: The value of P s (d i , SF)| nowind (19) is also representative of the case when the transmission times of the sensors are resynchronized during a UAV pass for the next one, based on the new expected UAV route and the wind forecasts using time D i . As noted, using the robustness parameter η(SF) in Section 4, Figure 14 shows that SF = 10 provides better results than SF = 7. In particular, with SF = 10, the probability of success in a single pass P s (d i , SF) is 77% at 1 km and decreases to 60% at 5 km. However, with two passes, we obtain much better results with a 94% probability of success at 1 km and an 85% probability of success at 5 km. The results improve and are close to 96% at any distance d i if we consider two UAV passes without winds or using our synchronization method. These results motivate the adoption of our proposed synchronization protocol.
In our study, we can determine P LoS at the transmission time of the generic sensor at distance d i along the UAV's path. In our model, the nominal transmission time for the sensor at distance d i along the UAV's route is set to time T 0s,i , assuming that the UAV ideally starts to scan its path at time t 0 = 0. The UAV flies with actual speed v and a departure time offset from time t 0 = 0 equal to t s . Then, the distance covered by the UAV along its route at the sensor transmission time is y UAV (T 0s,i ), calculated as: Based on our assumptions, the generic i-th sensor transmits when the UAV is at a distance y U AV (T 0s,i ) − d i with respect to the UAV's nominal position d i . Since this sensor is at a distance x from the path and the UAV flies at an altitude H, we can determine the elevation angle ϑ(d i ) as follows: where we consider ϑ(d i ) expressed in degrees. Because of our model, ϑ(d i ) depends on random variables v and t s . Therefore, if we apply (6) with ϑ = ϑ(d i ) given by (21) to express probability P LoS , this is conditioned on both v and t s . We remove the conditioning using a double integral and referring to those configurations of (v, t s ) i that allow successful a sensor to transmit when the UAV passes close to it. These configurations of (v, t s ) i correspond to the event V i that occurs with probability P s (d i , SF) in (17). We obtain the following result: The behavior of P LoS (d i , SF|V i ) is shown in Figure 15 for SF = 7 and 10. This graph also shows the results in the no wind case that also corresponds to the situation when the sensor's transmission is synchronized with the UAV. As performed by our protocol, we can see that the synchronization scheme permits the sensors to transmit in the best LoS conditions to the UAV. For this type of result, SF = 7 is better than SF = 10 since at SF = 7, the visibility interval and thus the range of ϑ(d i ) values have a smaller extension around the optimal central value. On the other hand, we have considered here conditioned probabilities P LoS (d i , SF|V) to the UAV in the visibility interval so that, by multiplying P LoS (d i , SF|V i ) by P s (d i , SF) to obtain the joint probability of transmission during the interval of UAV visibility and LoS conditions, we have that SF = 10 is the most convenient choice.
where we consider ( ) expressed in degrees. Because of our model, ( ) depends on random variables v and ts. Therefore, if we apply (6) with = ( ) given by (21) to express probability PLoS, this is conditioned on both v and ts. We remove the conditioning using a double integral and referring to those configurations of ( , ) that allow successful a sensor to transmit when the UAV passes close to it. These configurations of ( , ) correspond to the event Vi that occurs with probability ( , ) in (17). We obtain the following result: The behavior of ( , | ) is shown in Figure 15 for SF = 7 and 10. This graph also shows the results in the no wind case that also corresponds to the situation when the sensor's transmission is synchronized with the UAV. As performed by our protocol, we can see that the synchronization scheme permits the sensors to transmit in the best LoS conditions to the UAV. For this type of result, SF = 7 is better than SF = 10 since at SF = 7, the visibility interval and thus the range of ( ) values have a smaller extension around the optimal central value. On the other hand, we have considered here conditioned probabilities ( , | ) to the UAV in the visibility interval so that, by multiplying

Experiments and Results
This section reports the results of the propagation study on the use of LoRa technology in a rural scenario, as well as the validation of the opportunistic protocol obtained through tests carried out in the laboratory, which are focused on the correct functionality of the synchronization protocol between the GW and the nodes.

Propagation Study
This sub-section describes an experimental testbed for a preliminary study on ground propagation conditions. Our hardware is based on the Semtech SX1276 LoRa transceiver embedded on both the GW and the end node, operating at 868 MHz (EU frequency band for LoRa). Nodes are equipped with an Arduino UNO board and powered by a 9 V battery. The GW adopts a 400 MHz ar9331 processor with 64 MB RAM and 16 MB flash memory for the GW management system and an ATMega328P MCU with 2 kB of RAM and 32 kB of flash memory for the LoRa part. The LoRa communication is set with an uplink transmission power P t = 25 mW (i.e., 14 dBm).
In this case, we study propagation, and we do not impose special constraints on P t because we like to use a strong signal. At both the end node and the GW, antennas are normal-mode helical antennas (with a radiation pattern similar to a 1/4−λ monopole antenna) used in the vertical position. Hence, we consider the following antenna gains at both transmitter and receiver: G tx = G rx = 2 dBi. Moreover, we have a total cable and connector losses L con = 2 dB. The spreading factor is set to 7, with a bandwidth of 125 kHz, coding rate = 4/5, payload = 8 bytes, and preamble length = 8 bytes (sensor ID plus two additional bytes). All the setup parameters have been summarized in Table 4. In this work, we have conducted a preliminary study focused on the propagation of UAV adoption and emulating its effects, so the GW has been placed on top of a hill, as detailed below. The GW has been installed in a fixed location, while sensor nodes have been disseminated in different positions in the territory. From this study, we expect to obtain a useful benchmark to evaluate the path loss when sensors are very close to the ground. Figure 16 shows the GW, attached 2.5 m outside a building, at 10 m from the ground. The end nodes have been placed in LoS positions at different distances from the GW (i.e., 0.5, 1, 1.5, and 3 km, obtained by GPS coordinates). The sensor node has been positioned at five different heights from the soil (i.e., 0, 20, 50, 100, and 150 cm), as depicted in Figure 17.
The selected distances for our study allow us to consider the propagation in far-field conditions. Figure 18 provides the altitude profile of the deployment testbed for checking the First Fresnel Zone (FFZ) clearance condition. This zone is not obstructed because the ellipsoid from the transmitter and receiver in Figure 18 is free from obstacles or is obstructed by less than 20%. Hence, the scenario is in LoS conditions. The maximum clearance distance of FFZ, F 1 , can be determined according to the following formula: where f is the transmission frequency in GHz (0.868 in the LoRa case for the EU zone) and d is the distance between the transmitter and receiver in m. For instance, F 1 = 9.3 m for d = 1 km and F 1 = 16 m for d = 3 km.
For the sake of completeness, we have to consider that propagation experiments carried out in the presence of flat ground (this is not our case, as shown in the following Figure 18, where the GW is on top of a hill and the valley does not have a constant profile) are characterized by a two-ray propagation model with a cut-off distance d t . Before such a distance, the signal reflections positively or negatively sum so that the path loss attenuation oscillates even for slight differences in the distances; above such a cut-off distance, the path loss attenuation becomes more regular (with an exponent g = 4). We have: where h n is the altitude of the sensor node from the ground, l is the wavelength and H is the UAV's altitude. For instance, for h n = 0.2 m and H = 120 m, d t = 278 m for the 868 MHz EU LoRa case.  The selected distances for our study allow us to consider the propagation in far-field conditions. Figure 18 provides the altitude profile of the deployment testbed for checking the First Fresnel Zone (FFZ) clearance condition. This zone is not obstructed because the ellipsoid from the transmitter and receiver in Figure 18 is free from obstacles or is obstructed by less than 20%. Hence, the scenario is in LoS conditions. The maximum clearance distance of FFZ, F1, can be determined according to the following formula:  The selected distances for our study allow us to consider the propagation in far-field conditions. Figure 18 provides the altitude profile of the deployment testbed for checking the First Fresnel Zone (FFZ) clearance condition. This zone is not obstructed because the ellipsoid from the transmitter and receiver in Figure 18 is free from obstacles or is obstructed by less than 20%. Hence, the scenario is in LoS conditions. The maximum clearance distance of FFZ, F1, can be determined according to the following formula: where hn is the altitude of the sensor node from the ground, l is the wavelength and H is the UAV's altitude. For instance, for hn = 0.2 m and H = 120 m, dt = 278 m for the 868 MHz EU LoRa case. We study a path loss model as in (3) by introducing a log-normal shadowing term . In particular, is a Gaussian random variable with zero-mean and standard deviation sp. This model is based on three parameters as L(d0), g, and sp. With respect to (3), we neglect the attenuation due to vegetation in this scenario and refer to far-field conditions. Extra complexity in the propagation study is due to the closeness of sensors to the ground We study a path loss model as in (3) by introducing a log-normal shadowing term X. In particular, X is a Gaussian random variable with zero-mean and standard deviation s p . This model is based on three parameters as L(d 0 ), g, and s p . With respect to (3), we neglect the attenuation due to vegetation in this scenario and refer to far-field conditions. Extra complexity in the propagation study is due to the closeness of sensors to the ground that may partially obstruct the FFZ for the transmission with the GW [36], as further discussed below.
For each distance (i.e., 0.5, 1, 1.5, 3 km) of the sensors from the GW, the Received Signal Strength Indicator (RSSI) and the Signal-to-Noise Ratio (SNR) values have been measured at the GW side. Such measurements are related to the LoRa packets transmitted by the nodes. RSSI reports the amount of power received, including the received useful signal and the background noise. Then, we calculated the received power level P r from both RSSI [dBm] and SNR [dB] measurements as follows: The P r value is used to determine the path loss attenuation L(d) according to the link budget terms as follows: We performed multiple measurements of both the RSSI and SNR for distances of 0.5, 1, 1.5, and 3 km. We repeated the measurement of each distance five times, varying the node positions to avoid possible measurement biases due to small local obstacles. Then, we used (25) and (26) to determine the corresponding path loss attenuation L(d) values. We have adopted a linear fitting (i.e., least square) method with a "non-fixed intercept" L(d 0 ) that is considered an outcome of the fitting process [37]. The slope of the fitted line using log-scale distance yields the path loss exponent g. Finally, the standard deviation of the shadowing s p has been obtained as the standard deviation of the difference between the path loss measures and the corresponding linear fitting. The results of the linear fitting are provided in Figure 19, which also shows the comparison with the free-space path loss model, the Okumura-Hata model for rural areas (sensors at 1 m from the ground), and the path loss model used in Section 3 derived from [29] in a similar scenario (sensors at 20 cm from the ground). Confidence intervals (max values) are ± 0.5% around the central (mean) value, considering five repetitions and the method to compute confidence intervals based on Student's distribution. The parameter values of our path loss model fitting the measurements are shown in Table 5.
Based on the results shown in Figure 19 and Table 5, we can say that, in our scenario, the path loss exponent is close to γ = 2, as in the free-space case, but there are cases with a γ below 2, which could be caused by reflections off of buildings close to the experimental site and diffraction by trees [36,38,39]. We can see that this model has significant deviations with respect to other propagation models for rural areas in the literature. The Pr value is used to determine the path loss attenuation L(d) according to budget terms as follows: We performed multiple measurements of both the RSSI and SNR for distance 1, 1.5, and 3 km. We repeated the measurement of each distance five times, vary node positions to avoid possible measurement biases due to small local obstacles we used (25) and (26) to determine the corresponding path loss attenuation L(d) We have adopted a linear fitting (i.e., least square) method with a "non-fixed int L(d0) that is considered an outcome of the fitting process [37]. The slope of the fit using log-scale distance yields the path loss exponent g. Finally, the standard devi the shadowing sp has been obtained as the standard deviation of the difference b the path loss measures and the corresponding linear fitting. The results of the linea are provided in Figure 19, which also shows the comparison with the free-space p model, the Okumura-Hata model for rural areas (sensors at 1 m from the groun the path loss model used in Section 3 derived from [29] in a similar scenario (senso cm from the ground). Confidence intervals (max values) are ± 0.5% around the (mean) value, considering five repetitions and the method to compute confidenc vals based on Student's distribution. The parameter values of our path loss mode the measurements are shown in Table 5. Figure 19. Path loss model based on measurements (circles with distinct colors depend on tance of the sensor from the ground) and comparison with models from the literature (i.e., fr path loss, Okumura-Hata for rural areas, and another model from [29]). Figure 19. Path loss model based on measurements (circles with distinct colors depend on the distance of the sensor from the ground) and comparison with models from the literature (i.e., freespace path loss, Okumura-Hata for rural areas, and another model from [29]). Our results also show an impact on the path loss due to closeness of the sensor to the ground. In particular, the path loss increases as the sensor's distance from the ground decreases: there is an increase of 6 dB from the sensor at 150 cm to the sensor on the ground. This is an interesting aspect to consider for this type of IoT application. The shadowing standard deviation σ p is relatively low, around 1 dB for sensors closer to the ground and around 2 dB for sensors at 50, 100, and 150 cm from the ground.
Even if the proposed path loss model from our experiments adopts a ground GW positioned on top of a hill, we can consider that these results can (approximately) represent the path loss attenuation for the case with the GW onboard a UAV flying at a low altitude. As explained in the concluding sections, the study of the path loss with a GW onboard a UAV is left to future work.

Preliminary Validation of the Opportunistic Protocol in the Laboratory
This section describes the experimental testbed conducted in the laboratory to preliminarily validate the synchronization protocol, specifically designed for the communication between ground nodes and UAV-GW. The lab experiment envisages the adoption of sensor nodes and a moving GW (Dragino LG01N, which will be placed onboard a UAV in a real case) connected to the Internet via WiFi. This scenario has been realized in the lab by placing two nodes on a table at a mutual distance of 10 m and moving the GW at a constant speed to simulate the UAV flying over the two nodes, as detailed below. We have set P t = 0 dBm and removed the LoRa antennas mounted on both the sensor nodes and the GW, thus increasing the attenuation loss. This setup has resulted in a coverage radius R of about 4 m. Such coverage has been empirically verified through measurements based on RSSI values of packets transmitted from the node to the moving GW. To emulate the pass of the UAV, the GW is moved closer to and further away from the nodes at a speed v of about 0.2 m/s so that its visibility time D vi = 2R/v = 8/0.2 = 40 s is consistent with the UAV's visibility time, as shown in Figure 7 for P t = 3 dBm and SF = 7. Our laboratory model is thus adopting a scale factor of 1:100 with respect to the size of the actual scenario. By conducting this test, we have verified the node communication timing and the correct functionality of the opportunistic protocol with the exchange of sensor packets and the GW ACK.
The laboratory demo hardware (sensor nodes and GW) is depicted in Figure 20 and is the same hardware adopted for the propagation study described in the previous sub-section. For each node, the route management algorithm provides the sleeping time duration Δi based on the synchronism adjustment term δi in a specific function, and this value has been retrieved by the GW code. Then, the sleeping time duration Δi is correctly delivered to each node through ACKs. The reception of such values has been verified in the laboratory using Arduino IDE's serial monitor on the nodes. Finally, the received sleeping time values have been correctly elaborated and adopted by the nodes, which woke up at the For each node, the route management algorithm provides the sleeping time duration ∆ i based on the synchronism adjustment term δ i in a specific function, and this value has been retrieved by the GW code. Then, the sleeping time duration ∆ i is correctly delivered to each node through ACKs. The reception of such values has been verified in the laboratory using Arduino IDE's serial monitor on the nodes. Finally, the received sleeping time values have been correctly elaborated and adopted by the nodes, which woke up at the correct time for the next transmission corresponding to the next GW pass.
In our tests, the collision events were not investigated due to the extremely low number of nodes (i.e., two nodes, out of range from each other) and the sporadic transmissions (i.e., one packet sent every two minutes). However, a specific routine can be introduced in the GW to detect packet losses (thus including the effects of collisions), which involves counting the received packets and comparing them with the expected number of packets to be received (i.e., the number of nodes to be visited). Figures 21 and 22 show key parts of the code implemented on the GW and end nodes for the synchronization protocol, as depicted in Figure 9. Specifically, Figure 21 provides the code for the sensor node, showing that the device sends its ID and a dummy temperature measure. Then, it waits for the ACK from the GW, and when the ACK from the GW is received, it is parsed to check if the ACK is related to its data packet. Then, the sleeping time ∆ i is obtained from the ACK and used to wait for the subsequent transmission attempt. Figure 22 shows the code for the GW/server node waiting for packets. When a packet is received, the server parses it to obtain the node ID, which is needed to calculate the sleeping time specific to that node (i.e., through a specific function interfaced with the UAV's route management system, as explained in Section 4). Then, the GW sends back an ACK containing node ID and its sleeping time ∆ i . It should be noticed that the parameters in the payload of the message sent by the node (i.e., ID1 TEMP TSTAMP GPSCOORD) and related ACK (i.e., ID1 5000) in Figures 21 and 22 are just dummy values to validate the protocol's behavior.

Discussion
The work carried out in this paper represents an interesting step toward the study of the communication between ground sensors and a GW flying onboard a UAV. First of all, we have identified LoRa technology as a valid solution to allow communication from low-

Discussion
The work carried out in this paper represents an interesting step toward the study of the communication between ground sensors and a GW flying onboard a UAV. First of all, we have identified LoRa technology as a valid solution to allow communication from low-power sensors to the GW. Second, we have investigated propagation aspects and identified a protocol to synchronize the LoRa node transmissions with the UAV pass, showing some criticalities and preferred settings in terms of the LoRa spreading factor and the transmission power levels for the sensor nodes (i.e., SF = 10 and P t = 6 dB).
It is difficult to assess a propagation model that is quite general since the actual path loss is strongly influenced by the environmental conditions surrounding the transmitter and receiver and the obstacles between them. In our preliminary path loss study, we highlighted the importance of placing the GW on top of a hill to achieve better LoS with distant nodes. Signal propagation is affected by local reflections, whose impact on the received power level is more significant when the receiver and transmitter are close. Then, an important lesson learned is to investigate the path loss at a distance larger than the so-called cut-off distance to minimize these effects. Further work is also needed to replicate our experiments using a UAV to determine a path loss model for ground-to-air and air-toground communications. For such experiments, a rotary-wing UAV is needed to hover over a given position.
As for limitations concerning the opportunistic protocol, we have addressed only the communication protocol between the nodes and the GW in the laboratory without using a UAV. Another limitation of the correct functionality of the system is represented by meteorological conditions, namely, strong wind and rain events, which affect the UAV's flight capability and the LoRa communication range. In addition to this, vegetation and the presence of dense trees can reduce the visibility of the nodes and increase path loss propagation, thus requiring a site-specific propagation study. Further development will be needed to conduct field experiments with UAVs to test the robustness of the synchronization scheme.
Our UAV-based IoT system and the designed synchronization protocol are useful not only for smart agriculture and environmental monitoring but can also be adopted for emergency applications, infrastructure monitoring, rescue operations, and other scenarios involving opportunistic connectivity where coverage infrastructure is missing.

Conclusions
This paper studies the opportunistic communication of ground IoT nodes with a GW flying onboard a UAV for scanning rural or remote areas for smart agriculture and environmental monitoring applications. This system is conceived for low-power IoT nodes in remote areas without terrestrial connectivity.
A UAV flight dynamics model has been exploited based on the Matlab UAV Toolbox, which allows the prediction of the next time the UAV will pass close to each sensor along a pre-determined route. The LoRa/LoRaWAN radio technology has been adopted for the communication of IoT nodes with the GW because such technology allows low-power, long-range communications.
An opportunistic protocol has been proposed to allow communication between sensor nodes and the GW on the UAV. Sensor nodes use LoRa Class A, keeping the communication module in sleep mode most of the time and waking up and transmitting data right when the UAV passes close to them. This approach allows for significantly better energy efficiency and longer endurance of the sensors' batteries.
Furthermore, an analytical approach based on a system model has allowed for predicting the probability that the sensor can communicate during the UAV visibility time.
On-the-field propagation measurements have been carried out to assess how the closeness of the sensors to the ground can impact path loss attenuation. A preliminary laboratory implementation has allowed the validation of the designed synchronization protocol for ground IoT nodes. Future work is needed to replicate the propagation study and the protocol test using a GW on the UAV and ground sensors.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.